package jdk8.homework.Demo03;

import java.util.function.Supplier;

public class Demo03 {
    public static void main(String[] args) {
        Person person = getPerson(() -> {
            Person p = new Person("jhh", 21);
            return p;
        });
        System.out.println(person);

    }

    private static Person getPerson(Supplier supplier) {
        return (Person) supplier.get();
    }
}
